//
//  FileService.h
//  Common
//
//  Created by guoshiqing on 2018/6/1.
//  Copyright © 2018年 www.bitkinetic.com. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Macro.h"
#import "BaseJSONEntity.h"
#import "FileManager.h"

typedef void(^DownLoadSuccessBlock)(void);
typedef void(^DownLoadProgressBlock)(float progress);
typedef void(^DownLoadFailBlock)(NSString *message);
@interface FileService : NSObject

@property (copy, nonatomic) String2Block successBlock;
@property (copy, nonatomic) ProgressBlock progressBlock;
@property (copy, nonatomic) StringBlock failureBlock;

@property (copy, nonatomic) DownLoadSuccessBlock downLoadSuccess;
@property (copy, nonatomic) DownLoadProgressBlock downLoadProgress;
@property (copy, nonatomic) DownLoadFailBlock downLoadFail;

// 注册block
- (void)registerSuccessBlock:(String2Block)successBlock
           WithProgressBlock:(ProgressBlock)progressBlock
            WithFailureBlock:(StringBlock)failureBlock;

// 注册下载的block
- (void)registerDownLoadSuccessBlock:(DownLoadSuccessBlock)downLoadSuccess
           WithDownLoadProgressBlock:(DownLoadProgressBlock)downLoadProgress
               WithDownLoadFailBlock:(DownLoadFailBlock)downLoadFail;


// 拷贝文件到沙盒，并发送获取token的请求
- (void)sendFileWithImage:(UIImage *)image andImageName:(NSString *)imageName andModuleType:(EPModuleType)type andFileType:(NSString *)fileType;


// 上传图片到云盘
- (void)sendCloudDiskWithImage:(UIImage *)image andImageName:(NSString *)imageName andTeamId:(NSString *)teamId andFileSize:(NSString *)fileSize;

// 上传视频到云盘
- (void)sendCloudDiskWithVideo:(NSURL *)url andVideoName:(NSString *)videoName andTeamId:(NSString *)teamId andFileSize:(NSString *)fileSize;

// 下载文件到本地
- (void)downloadCloudDiskInfoWithUrl:(NSString *)url andTeamId:(NSString *)teamId andFileName:(NSString *)fileName;

// 取消下载文件
- (void)cancelDownloadCloudDiskInfoWithTeamId:(NSString *)teamId andFileName:(NSString *)fileName;

@end
